package com.android.youwenchuang.util;

import com.android.youwenchuang.bean.News;
import com.blankj.utilcode.constant.TimeConstants;
import com.blankj.utilcode.util.TimeUtils;

public class NewsUtil {

    public static String getMoban(News news) {
        return  "<html lang=\"en\">\n" +
                " <head> <meta charset=\"UTF-8\">\n" +
                "    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">" +
                "    <title>新闻详情</title> <style type=\"text/css\"> .viewport{ width:100%  ; } </style>  </head>\n" +
                "    <body>\n" +
                "        <p style=\"font-size: 16px;\"> " + news.getTitle() + "</p>\n" +
                "        <div>\n" + TimeUtils.getString(news.getDate(), 0, TimeConstants.MSEC) +
                "        </div>\n" +
                "        <div>\n" + news.getUser() +
                "        </div>\n" +
                "        <div>\n" +
                "            <img  style=\"width: 100%;\" src=\"" +news.getPics() + "\"/>\n" +
                "        </div>\n" +
                "        <div>\n" + news.getContent() +
                "        </div>\n" +
                "    </body>\n" +
                "</html>";
    }
}
